home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / wildcat / logtrim.zip / LOGTRIM.DOC < prev    next >
Text File  |  1992-01-26  |  4KB  |  106 lines

  1.  
  2.               LOGTRIM  version 3.03 released 1/26/92
  3.            A public domain utility for Wildcat! Sysops            
  4.                     by Michael Conley, Sysop
  5.                       The Charlatan's Cabin
  6.                          (213) 654-7337
  7.  
  8. WHAT IT DOES:
  9. =============
  10.  
  11. LOGTRIM is a generic LOG file trimmer which will scan any ASCII log
  12. and delete all file lines until it encounters a user specified date.
  13.  
  14. Suggested applications include the Wildcat!  ACTIVITY.LOG and the
  15. TNet TNET.LOG, as well as virtually ANY ASCII chronological log.  The 
  16. file extension ".LOG" is required on the file you're going to trim.
  17.  
  18. HOW TO USE IT:
  19. ==============
  20.  
  21. LOGTRIM may be used interactively, or from the command line, or in a batch
  22. file.
  23.  
  24. First, log into the directory where your .LOG file exists.  Next, invoke 
  25. LOGTRIM.  The first screen will ask for the file name of the LOG, and the
  26. number of days to keep.  It will calculate based upon the current system 
  27. date and then trim the log, keeping entries on or after the specified date.
  28.  
  29. If the specified date is NOT found, no action is taken and the log is
  30. left intact.
  31.  
  32. If the LOG file is trimmed, you'll find that the original has been saved
  33. with the extension '.BAK' in the event LOGTRIM should do something terrible
  34. to your file. (Not likely, but I like to be safe.)
  35.  
  36. Using LOGTRIM from a batch file (or directly from the command line) involves
  37. specifying two items on the command line.  These are the NAME of the log file
  38. and the NUMBER of days to keep (any value between 2 and 365 is acceptable.)
  39.  
  40. For example:
  41.  
  42. LOGTRIM ACTIVITY 15
  43.  
  44. would keep all entries within the past 15 days.  Incidentally, LOGTRIM will
  45. search for either the '/' or the '-' separator in dates, so a log file that
  46. refers to the date as MM/DD/YY or MM-DD-YY would be parsed identically.
  47.  
  48. Beginning with version 3.02, LOGTRIM will automatically test for any of 12
  49. date formats:  MM-DD-YY, MM/DD/YY, MM-DD-YYYY, MM/DD/YYYY, 
  50. or low month:  M-DD-YY, M/DD/YY, M-DD-YYYY, M/DD/YYYY, or
  51. the European:  YY-MM-DD, YY/MM/DD, YYYY-MM-DD, YYYY/MM/DD. 
  52.  
  53. If your log file happens to show the date in another format, LOGTRIM 
  54. won't work.
  55.  
  56. The program requires no user interaction and will exit upon conclusion, 
  57. even if the log file isn't found or the date is not matched.
  58.  
  59. USE WITH WCPRO!:
  60.  
  61. Here's a suggestion.  If you use WCPRO! to produce a STATISTICS file,  you may 
  62. have noticed it can optionally maintain internal .HST (history) files and 
  63. delete the ACTIVITY.### files after it runs.  I like to run it in this mode, 
  64. but I don't like having the
  65. ACTIVITY.LOG tossed out each night before I get a chance to review it.
  66.  
  67. This is a clip from my nightly BBS Maintenance batch file which lets you
  68. append the log onto a backup copy before running WCPRO!  Then you may
  69. use LOGTRIM to keep the backup copy from getting out of hand.
  70.  
  71. BATCH FILE EXAMPLE:
  72.  
  73. IF EXIST \BACKUP\ACTIVITY.OLD DEL \BACKUP\ACTIVITY.OLD
  74. REN \BACKUP\ACTIVITY.LOG \BACKUP\ACTIVITY.OLD
  75. COPY \BACKUP\ACTIVITY.OLD+\CAT\ACTIVITY.LOG \BACKUP\ACTIVITY.LOG
  76. WCPRO! ... (include whatever command line options you wish)
  77. CD \BACKUP
  78. LOGTRIM ACTIVITY 15
  79. CD \CAT
  80. .......
  81.  
  82. In this example, you are preserving a copy of your activity log in a 
  83. directory called \BACKUP.   First, you delete any existing copy of
  84. \BACKUP\ACTIVITY.OLD, and then you REName \BACKUP\ACTIVITY.LOG to
  85. \BACKUP\ACTIVITY.OLD.  Next you write a new \BACKUP\ACTIVITY.LOG
  86. containing first \BACKUP\ACTIVITY.OLD followed by your current ACTIVITY.LOG
  87. from the \CAT directory.
  88.  
  89. Now, you may run WCPRO!, which will delete ACTIVITY.LOG upon conclusion 
  90. of its run.
  91.  
  92. Finally, you change directory to \BACKUP, and run LOGTRIM, specifying a
  93. 15-day-holding period.   This keeps the backup log from getting too large, 
  94. but you always have the past 15 days should you need to refer to it.
  95.  
  96. LOGTRIM is contributed to the public domain by Michael A. Conley, with
  97. the understanding that it may be freely distributed without limitation
  98. except that it may not be offered for sale.
  99.  
  100. Comments  and  suggestions  are  welcome  ...  please  call   the 
  101. Charlatan's Cabin BBS at (213) 654-7337.  If you're a registered 
  102. Wildcat! SysOp, leave a Comment to the SysOp indicating this, and
  103. include your Wildcat! registration number, and I'll upgrade you to
  104. member level access without the bother of registration by mail.
  105.  
  106.